package com.ph.shopping.facade.profit.service.impl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

import com.ph.shopping.common.core.base.BaseService;
import com.ph.shopping.common.util.result.Result;
import com.ph.shopping.facade.profit.service.IProfitService;

@Component
public class UnLineOrderSupplyChainProfitScheduler extends BaseService {

	@Autowired
	private IProfitService iProfitService;

	//@Scheduled(cron = "0 0 1 */7 * ?")
	@Scheduled(cron = "0 */1 * * * ?")
	public void doProfit() {
		logger.debug("每隔7天凌晨1点执行---------->开始");
		try {
			System.out.println("商户供应链分润");
			Result result = iProfitService.executiveUnLineOrderSupplyChainProfit();
			if(result.getCode()=="200"){
				logger.info("供应链分润成功");
			}
		} catch (Exception e) {
			logger.error("供应链分润失败");
			e.printStackTrace();
		}
	}
}

